// 14_1
package main

import (
	"fmt"
)

func main() {
	s := []int{0, 0}
	for i := 1; i < 1000000; i++ {
		n := term(i, 0)
		if s[1] < n {
			s[0], s[1] = i, n
		}
	}
	fmt.Println(s[0])
}
func term(n, i int) int {
	i++
	if n == 1 {
		return i
	}
	if n%2 == 0 {
		return term(n/2, i)
	} else {
		return term(3*n+1, i)
	}
}
